package applogic;
import java.util.*;

public class Rsvp {
	private int rsvp;
	private int aid;
	private String description;
	User user;
	
	public Rsvp(int appointmentId,User user, int rsvp, String description)
	{
		this.rsvp = rsvp;
		this.user = user;
		this.aid = appointmentId;
		this.description = description;
	}
	
	public Rsvp(String netMsg)
	{
		StringTokenizer st = new StringTokenizer(netMsg,",");
		this.rsvp = Integer.parseInt(st.nextToken());
		this.aid = Integer.parseInt(st.nextToken());
		this.description = netMsg.substring(netMsg.length()-64);
	}
	
	public void setRsvp(int num) {
		this.rsvp = num;
	}
	
	public int getRsvp(){
		return rsvp;
	}
	
	public String toMessage(){
		return "rsvp,"+rsvp+","+aid+","+user.getUser()+","+description;
	}
	
	public String toSQL(){
		return "";
	}
	
	public String getDescription()
	{
		return description;
	}

	public User getUser() {
		return user;
	}

	public int getAid() {
		return aid;
	}
	
	public String toString()
	{
		return ""+rsvp+" "+aid+" "+user;
	}

}
